package com.qfjy.mapper;

import com.qfjy.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

     @Select("select * from user where wid=#{wid}")
    User selectUserByWid(int wid);

    /**
     * 根据邮箱查询用户是否存在
     * @param email
     * @return
     */
     @Select("select * from user where email=#{email}")
     User selectUserByEmail(String email);

     @Update("update user set wid=#{wid} where email =#{email}")
     int updateUserWidByEmail(int wid,String email);

    /**
     * 抢单者列表
     * @param pid
     * @return
     */
     List<User> selectUserByPid(String pid);
}